@(localUser: models.gsn.auth.User = null)

@import com.feth.play.module.pa.views.html._

@main(Messages("playauthenticate.profile.title"),"profile") {

    <h1>@Messages("playauthenticate.profile.title")</h1>
    <p>
    Your name is @localUser.name and your email address is @if(!localUser.email) {<em>&lt;unknown&gt;</em>.} else {
    	@localUser.email.
	    <i>
	    @if(!localUser.emailValidated && localUser.email) {
	      (<a href="@controllers.gsn.auth.routes.Account.verifyEmail">unverified - click to verify</a>)
	    } else {
	      (verified)
	    }</i>
    }
    <br />
        @if(localUser.firstName && localUser.lastName) {
            Your first name is @localUser.firstName and your last name is @localUser.lastName
            <br/>
        }
    @defining(localUser.getProviders()) { providers =>
        @if(providers.size() > 0) {
        @if(providers.size() ==1) {
            @Messages("playauthenticate.profile.providers_one")
        } else {
            @Messages("playauthenticate.profile.providers_many",providers.size().toString())
        }
        @for(p <- providers) {
            @_providerIcon(p)
        }
        <br/>
        }
    }

    <br/>
    @currentAuth() { auth =>
        @Messages("playauthenticate.profile.logged") @_providerIcon(auth.getProvider())<br/>
        @if(auth.expires() != -1){
            @Messages("playauthenticate.profile.session", auth.getId(), controllers.gsn.auth.LocalAuthController.formatTimestamp(auth.expires()))
        } else {
            @Messages("playauthenticate.profile.session_endless", auth.getId())
        }
    }
    <br/>
    <ul>
    	<li><a href="@controllers.gsn.auth.routes.Account.changePassword">@Messages("playauthenticate.profile.password_change")</a></li>
    	<li><a href="@controllers.gsn.auth.routes.Account.editProfile">@Messages("playauthenticate.profile.edit")</a></li>
    </ul>
    </p>
}
